"""
https://www.qimingpian.com/innovate
"""
import requests

from functools import partial
import subprocess
subprocess.Popen = partial(subprocess.Popen, encoding="utf-8")
import execjs
url = "https://vipapi.qimingpian.cn/search/recommendedItemList"
data = {
    "page": 1,
    "num": 20,
    "sys": "vip"
}
res = requests.post(url, data=data)
info = res.json()["encrypt_data"]
print(info)

with open("./js/qimingpian.js", "r") as f:
    content = f.read()
    js_code = execjs.compile(content)
    result = js_code.call("s", info)
    for data in result['list']:
        print(data)
